package com.common.converter;

import com.common.entity.personal.BusinessJobExperienceEntity;
import com.common.requestvo.judicialpersonal.BusinessJobExperienceReqVo;
import com.common.vo.judicialpersonal.BusinessJobExperienceVo;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mapstruct.factory.Mappers;

/**
 * @author johnny
 * @create 2020-07-13 下午5:04
 **/
@Mapper
public interface BusinessJobExperienceConverter {

    BusinessJobExperienceConverter INSTANCE = Mappers.getMapper(BusinessJobExperienceConverter.class);

    @Mappings({
            @Mapping(source = "createTime", target = "createTime", dateFormat = "yyyy-MM-dd HH:mm:ss"),
            @Mapping(source = "updateTime", target = "updateTime", dateFormat = "yyyy-MM-dd HH:mm:ss"),
            @Mapping(source = "experienceStartTime", target = "experienceStartTime", dateFormat = "yyyy-MM"),
            @Mapping(source = "experienceEndTime", target = "experienceEndTime", dateFormat = "yyyy-MM"),
    })
    BusinessJobExperienceVo domain2vo(BusinessJobExperienceEntity businessJobExperienceEntity);

    @Mappings({
            @Mapping(source = "createTime", target = "createTime", dateFormat = "yyyy-MM-dd HH:mm:ss"),
            @Mapping(source = "updateTime", target = "updateTime", dateFormat = "yyyy-MM-dd HH:mm:ss"),
            @Mapping(source = "experienceStartTime", target = "experienceStartTime", dateFormat = "yyyy-MM"),
            @Mapping(source = "experienceEndTime", target = "experienceEndTime", dateFormat = "yyyy-MM"),
    })
    BusinessJobExperienceEntity vo2domain(BusinessJobExperienceReqVo businessJobExperienceReqVo);
}